package com.dx.as.utils;

import android.content.Context;
import android.os.PowerManager;

import com.dx.as.JWCache;

/**
 * Created by jwaoo on 2017/9/8.
 */

public class WakeAndLock {
    PowerManager pm;
    PowerManager.WakeLock wakeLock;

    public WakeAndLock() {
        pm = (PowerManager) JWCache.getContext().getSystemService(Context.POWER_SERVICE);
        wakeLock = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP
                | PowerManager.SCREEN_DIM_WAKE_LOCK, "WakeAndLock");
    }

    /**
     * 唤醒屏幕
     */
    public void screenOn() {
        wakeLock.acquire();
        android.util.Log.i("cxq", "screenOn");
    }

}
